﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization.Json;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;

namespace AspNetSimple
{
    public class TJ
    {
        public long A { get; set; } = 9284856430002313;
    }
    class Program
    {
        // [STAThread]
        static void Main(string[] args)
        {
            new HttpClientSimple();
            //Torrent torrent = TorrentParser.Parse("F:\\迅雷下载\\91麻豆国产原创剧情片\\862274AEAB76C04A015ADB9FAEED01E72B5074FA.torrent");
            //Console.WriteLine(torrent.FileList.Count);
            // MaxVersionTest.Run();
            //Regex regex = new Regex("^\\d{4}-\\d{1,2}-\\d{1,2}");
            //Regex regex2 = new Regex("^\\d{4}/\\d{1,2}/\\d{1,2}");
            //Regex regex3 = new Regex("^\\d{1,2}-\\d{1,2}");
            //Regex regex4 = new Regex("^\\d{1,2}/\\d{1,2}");
            //string text = "2019/09/24";
            //if (regex.IsMatch(text) || regex2.IsMatch(text))
            //{
            //    string newColumnName = text.Substring(5).Replace('/', '-');
            //    Console.WriteLine(newColumnName);
            //}
            //else if (regex3.IsMatch(text) || regex4.IsMatch(text))
            //{
            //    string newColumnName = text.Replace('/', '-');
            //    Console.WriteLine(newColumnName);
            //}
            //Application.EnableVisualStyles();
            //Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new frmMain3());

            // string j = "{\"A\":9284856430002313}";

            //string j = JsonConvert.SerializeObject(new TJ());

            //Console.WriteLine(j);

            //TJ tj = JsonConvert.DeserializeObject<TJ>(j);

            //Console.WriteLine(tj.A);

            //Console.ReadKey();

            // new IOC.IOC_Simple();

            // new HttpClientSimple();

            //var first = DotNetExtensions.AspNet.Helpers.Combination.Create(new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35 }, 5);
            //var last = DotNetExtensions.AspNet.Helpers.Combination.Create(new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }, 2);
            //List<string> firsts = first.Select(c => string.Join(",", c)).ToList();
            //List<string> lasts = last.Select(c => string.Join(",", c)).ToList();

            //List<string> fulls = new List<string>();
            //for (int i = 0; i < firsts.Count; i++)
            //{
            //    for (int j = 0; j < lasts.Count; j++)
            //    {
            //        string number = $"{firsts[i]}+{lasts[j]}";
            //        fulls.Add(number);
            //    }
            //}
            //first.Clear(); firsts.Clear(); last.Clear(); lasts.Clear();
            //Console.WriteLine($"All Count:{fulls.Count}");

            //List<Data> datas = new List<Data>();
            //datas.Add(new Data { ID = 1, Code = "XM08" });
            //DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(List<Data>));
            //using (MemoryStream stream = new MemoryStream())
            //{
            //    serializer.WriteObject(stream, datas);
            //    string data = Encoding.UTF8.GetString(stream.ToArray());
            //    Console.WriteLine(data);
            //}

            //string json = "[{\"Id\":1,\"Code\":\"01\",\"Items\":[{\"Id\":1,\"Name\":\"01\",\"LongId\":\"120\"},{\"Id\":2,\"Name\":\"02\",\"LongId\":\"140\"}]}]";

            // List<Data> data = JsonObjectMapper.TryParseArrayJson<Data>(json);
            // Email.Send("p2soft@163.com");
            Console.ReadLine();
        }
    }
}
